Micron Document
πŸŽ–οΈGitΠ―Ρ€Π°πŸŽ–οΈ


Displaying Rendered β€’ View raw β€’ Download

.specify/memory/constitution.md bbef7670a13ecb0bbdd88f6a0ca886fc4bdb0e9a (bbef7670) Text, 10.92 KB

<!--
SYNC IMPACT REPORT
Version change: 1.3.2 β†’ 1.3.3
Modified principles:
β€’ IV. Privacy First: "core/proto read-only submodule" β†’ "org.meshtastic:protobufs Maven dependency" (protos are no longer a submodule)
Modified sections:
β€’ Architecture Constraints: Data Protocol de-submoduled; Language & Toolchain Kotlin 2.3+ β†’ 2.4+
Added sections: None.
Removed sections: None.
Templates requiring updates:
β€’ .skills/speckit/SKILL.md (constitution version + principle count 6 β†’ 7; added VI. Documentation Freshness)
β€’ .specify/templates/{plan,checklist}-template.md (Constitution Check: added Documentation Freshness; renumbered Verify Before Push β†’ VII)
β€’ .specify/templates/{plan,spec,tasks,checklist}-template.md (proto submodule β†’ Maven dependency)
Follow-up TODOs: None.
-->

Meshtastic Android (KMP) Constitution

Core Principles

I. Kotlin Multiplatform Core

Business logic MUST reside exclusively in T383838commonMain source sets. KMP-equivalent libraries
MUST be used in place of JVM/Android-specific APIs:

β€’ MUST use Okio (not T383838java.io), Ktor (not T383838java.net/OkHttp in common), Mutex/atomicfu
(not T383838java.util.concurrent), Room KMP, DataStore KMP, and Koin 4.2+.
β€’ MUST NOT import T383838java.* or T383838android.* in any T383838commonMain module.
β€’ Platform-specific implementations belong in T383838androidMain/T383838desktopMain actual
declarations only.
<!-- Rationale: Multi-platform parity (Android, Desktop, iOS). Framework bleed in commonMain breaks compilability on non-Android targets. -->

II. Zero Lint Tolerance

All code contributions MUST pass static analysis before merge:

β€’ T383838./gradlew spotlessApply MUST be run and T383838spotlessCheck MUST pass with no violations.
β€’ T383838detekt MUST pass with no new violations introduced.
β€’ A task or PR is considered incomplete if either check fails.
<!-- Rationale: Consistent code style and static analysis gates prevent technical debt accumulation. -->

III. Compose Multiplatform UI

All UI MUST use JetBrains Compose Multiplatform, not Android-only Jetpack Compose APIs:

β€’ MUST use T383838MeshtasticNavDisplay and T383838NavigationBackHandler for navigation across all
entry points.
β€’ Floats MUST be pre-formatted using T383838NumberFormatter.format() before display in any
composable.
β€’ UI MUST compile and render correctly on all supported targets (Android, Compose Desktop).
<!-- Rationale: Compose Multiplatform ensures UI consistency across platforms. -->

IV. Privacy First

The application handles sensitive mesh network data; user privacy MUST be protected at all
times:

β€’ MUST NOT log or expose PII, location data, or cryptographic keys in logs, crash reports,
or any debug output.
β€’ Secrets MUST be git-ignored and MUST NOT be committed to the repository under any
circumstances.
β€’ Protobuf models come from the upstream T383838org.meshtastic:protobufs Maven dependency (pinned
in T383838gradle/libs.versions.toml). MUST NOT hand-edit generated proto; proto changes require
an upstream change and a dependency version bump.
<!-- Rationale: Meshtastic users rely on the mesh for private, off-grid communications. Data leaks could endanger users in sensitive deployments. -->

V. Design Standards Compliance

All user-facing UI MUST conform to the Meshtastic Client Design Standards:

β€’ The canonical reference lives at:
T383838https://raw.githubusercontent.com/meshtastic/design/refs/heads/master/standards/meshtastic_design_standards_latest.md
β€’ New screens and significant UI changes (any screen with β‰₯3 composables or a new
navigation destination) MUST be reviewed against the design standards before merge.
β€’ Deviations from the design standards require explicit justification in the PR description
with a rationale for why the standard cannot or should not be followed.
β€’ Features that affect multiple platforms (messaging, settings, telemetry, etc.) MUST
reference an existing cross-platform behavior spec in
or create one using the T383838TEMPLATE.md in that directory before writing the
Android implementation spec. Platform-specific-only features (e.g., Android widget,
Wear OS tile) may mark the T383838Cross-Platform Spec field as N/A with justification.
<!-- Rationale: Consistent cross-platform UX ensures users have a predictable experience regardless of platform. -->

VI. Documentation Freshness

In-app documentation MUST remain accurate and current as the codebase evolves.
Documentation changes propagate to three consumers β€” all three MUST be considered:

1. In-app docs browser β€” T383838syncDocsToComposeResources copies T383838docs/ into Compose
Resources at build time. Changes are bundled into the app automatically.
2. Jekyll site (GitHub Pages) β€” T383838docs/ is served directly. The T383838docs-deploy.yml
workflow rebuilds on push to T383838main.
3. Docusaurus site (meshtastic.org) β€” T383838scripts/sync-android-docs.js transforms
T383838docs/ for the external site. Runs weekly via the T383838meshtastic/meshtastic repo.

Governance rules:

β€’ Every doc page MUST include a T383838last_updated frontmatter field (YYYY-MM-DD).
Update this field whenever page content changes.
β€’ PRs that modify user-facing UI source files MUST update the corresponding doc page(s)
or apply the T383838skip-docs-check label with justification. The docs staleness check is a
blocking CI gate.
β€’ Internal cross-references between doc pages and image paths MUST be validated; broken
links fail the T383838docs-governance workflow.
β€’ Every user-facing feature module MUST have corresponding documentation in T383838docs/user/
or T383838docs/developer/. Coverage is checked by T383838scripts/check-doc-coverage.js.
β€’ Pages older than 180 days without updates trigger an advisory freshness warning.
β€’ New doc pages MUST be registered in T383838DocBundleLoader.kt (in-app index), and added to
the T383838KNOWN_*_SLUGS sets in T383838sync-android-docs.js (Docusaurus link resolution).
Jekyll picks up new pages automatically via T383838_config.yml scope-based defaults.
β€’ Image references MUST use root-relative paths (T383838/assets/screenshots/filename.png) so
they resolve correctly in both Jekyll and the in-app renderer. The sync script rewrites
these to Docusaurus paths automatically.
<!-- Rationale: Documentation drift misleads users and increases support burden. Three distinct consumers means changes must be verified across all delivery channels. -->

VII. Verify Before Push

Local verification MUST complete successfully before any T383838git push:

β€’ MUST run T383838./gradlew spotlessApply spotlessCheck detekt plus relevant module T383838:test
tasks for all modules touched.
β€’ After pushing, CI status MUST be confirmed via T383838gh pr checks <PR> or
T383838gh run list --branch <branch> --limit 5. Phrases like "CI should be green" are
explicitly prohibited.
<!-- Rationale: Verification is a hard gate, not an optimistic assumption. Skipped local checks are the leading cause of CI failures. -->

Development Workflow

Non-negotiable workflow steps are defined in T383838AGENTS.md T383838<process_essentials>. Key
requirements: bootstrap before build, baseline verification before push, sort-strings after
adding resources, update T383838.agent_memory/session_context.md per session, plan complex
refactors (touching β‰₯3 modules or >200 LOC changed) in T383838.agent_plans/, limit context
reads to relevant modules.

Architecture Constraints

The following module boundaries and technology choices are fixed for this project:

β€’ KMP Modules: T383838core:domain (business logic), T383838core:data (repositories),
T383838core:database (Room KMP), T383838core:datastore (preferences), T383838core:network (Ktor),
T383838core:ble (Kable multiplatform BLE).
β€’ State Management: Unidirectional Data Flow (UDF) with ViewModels, Kotlin Coroutines,
and Flow. No reactive frameworks other than Coroutines/Flow in T383838commonMain.
β€’ Dependency Injection: Koin 4.2+ with Koin Annotations and the K2 Compiler Plugin.
No alternative DI framework may be introduced.
β€’ Navigation: JetBrains Navigation 3 for multiplatform routing with RESTful deep
linking. All navigation MUST use T383838MeshtasticNavDisplay.
β€’ Data Protocol: Protobuf for device communications (the T383838org.meshtastic:protobufs
Maven dependency). Room KMP for local persistence. DataStore for user preferences.
β€’ Language & Toolchain: Kotlin 2.4+ targeting JDK 21. Java source files MUST NOT be
introduced in KMP modules.

Operational Standards

The following coding standards are enforced by contextual instruction files
(T383838.github/instructions/) scoped to relevant source sets. They are acknowledged by this
constitution but defined and maintained in their respective files:

β€’ T383838safeCatching {} over T383838runCatching {} in coroutine/suspend contexts
β€’ T383838org.meshtastic.core.common.util.ioDispatcher over T383838Dispatchers.IO
β€’ T383838MeshtasticIcons (from T383838core/ui/icon/) over T383838material.icons.Icons
β€’ T383838MetricFormatter for display strings (temperature, voltage, percent, signal)
β€’ T383838stringResource(Res.string.key) with T383838python3 scripts/sort-strings.py after additions
β€’ T383838kotlinx.coroutines.CancellationException (not T383838kotlin.coroutines.cancellation.*)
β€’ Branch naming: T383838feat/, T383838fix/, T383838chore/, T383838docs/, T383838build/, T383838ci/, T383838refactor/,
T383838test/, T383838deps/, or numeric spec prefix; always off T383838origin/main

Governance

This constitution is the canonical governance document and supersedes all other practices,
coding guidelines, and agent instructions. T383838AGENTS.md is the agent-facing operational
summary derived from this constitution. The files T383838.github/copilot-instructions.md,
T383838CLAUDE.md, and T383838GEMINI.md MUST redirect to T383838AGENTS.md and MUST NOT diverge from it.

Amendment Procedure:
1. Propose the amendment with rationale and a migration plan in a PR description.
2. Update T383838AGENTS.md and this constitution atomically in the same commit.
3. Update all downstream references in the same commit:
β€’ T383838.skills/speckit/SKILL.md (principle count and descriptions)
β€’ T383838.specify/templates/checklist-template.md (checklist items)
β€’ T383838.specify/templates/plan-template.md (Constitution Check section)
β€’ The SYNC IMPACT REPORT comment at the top of this file
4. Increment T383838CONSTITUTION_VERSION per the versioning policy below.
5. All PRs and code reviews MUST verify compliance with the current constitution version.

Versioning Policy:
β€’ MAJOR: Backward-incompatible principle removal or fundamental redefinition.
β€’ MINOR: New principle or section added, or materially expanded guidance.
β€’ PATCH: Clarifications, wording fixes, or non-semantic refinements.

Compliance Review: Every implementation plan and PR description MUST include a
Constitution Check confirming all seven principles were evaluated. Complexity violations
require explicit justification in the Complexity Tracking table of the plan document.

Version: 1.3.3 | Ratified: 2026-05-07 | Last Amended: 2026-06-22

Served by rngit 1.5.2 - Generated in 0.13s